package cn.xjt.screenShare.main;

import javafx.application.Application;
import javafx.event.Event;
import javafx.event.EventHandler;
import javafx.event.EventType;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.scene.image.Image;
import javafx.stage.Stage;

import java.io.IOException;
import java.net.URLClassLoader;

public class Main extends Application {

    @Override
    public void start(Stage primaryStage){
        try {
            Parent root = null;
            try {
                root = FXMLLoader.load(URLClassLoader.getSystemResource("fxml/main.fxml"));
            } catch (IOException e) {
                e.printStackTrace();
            }
            primaryStage.setTitle("ScreenShare");
            Scene scene = new Scene(root);
            primaryStage.setScene(scene);
            primaryStage.getIcons().add(new Image("image/logo.png"));
            primaryStage.setResizable(false);
            primaryStage.show();
        }catch (Exception e){
            e.printStackTrace();
        }
    }


    @Override
    public void stop() {

        System.out.println("Stop");
        System.exit(0);
    }
}
